package com.project.bean;

import java.time.LocalDate;
import java.util.List;

/**
 * 商品订单实体类
 */
public class GoodsOrderBean {
    /**商品订单id*/
    private int id;
    /**商品订单状态*/
    private String state = "未发货";
    /**订单总价*/
    private int totalPrice;
    /**商品订单生成日期*/
    private LocalDate createDate = LocalDate.now();
    /**收货人*/
    private String addressName;
    /**收货人电话*/
    private String tel;
    /**收货人地址*/
    private String address;
    /**下单人*/
    private UserBean user;
    /**所属门店*/
    private StoreBean store;
    /**订单详情集合*/
    private List<GoodsOrderInfoBean> goodsOrderInfoList;


    public GoodsOrderBean() {
    }

    public GoodsOrderBean(int totalPrice, String addressName, String tel, String address, int userId, int storeId) {
        this.totalPrice = totalPrice;
        this.addressName = addressName;
        this.tel = tel;
        this.address = address;
        this.user = new UserBean();
        this.user.setId(userId);
        this.store = new StoreBean();
        this.store.setId(storeId);
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public int getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(int totalPrice) {
        this.totalPrice = totalPrice;
    }

    public LocalDate getCreateDate() {
        return createDate;
    }

    public void setCreateDate(LocalDate createDate) {
        this.createDate = createDate;
    }

    public String getAddressName() {
        return addressName;
    }

    public void setAddressName(String addressName) {
        this.addressName = addressName;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public UserBean getUser() {
        return user;
    }

    public void setUser(UserBean user) {
        this.user = user;
    }

    public StoreBean getStore() {
        return store;
    }

    public void setStore(StoreBean store) {
        this.store = store;
    }

    public List<GoodsOrderInfoBean> getGoodsOrderInfoList() {
        return goodsOrderInfoList;
    }

    public void setGoodsOrderInfoList(List<GoodsOrderInfoBean> goodsOrderInfoList) {
        this.goodsOrderInfoList = goodsOrderInfoList;
    }

    @Override
    public String toString() {
        return "GoodsOrderBean{" +
                "id=" + id +
                ", state='" + state + '\'' +
                ", totalPrice=" + totalPrice +
                ", createDate=" + createDate +
                ", addressName='" + addressName + '\'' +
                ", tel='" + tel + '\'' +
                ", address='" + address + '\'' +
                ", user=" + user +
                ", store=" + store +
                ", goodsOrderInfoList=" + goodsOrderInfoList +
                '}'+"\n";
    }
}
